/*
 * Creado por NIN
 * User: sebastian.lucas
 * Date: 19/04/2007
 * Time: 9:17
 */

using System;
using System.Drawing;

namespace CSE
{
	/*
	 * Workspace
	 */
	public class Workspace
	{
		/*
		 * Constants
		 */
	    public static readonly int TYPE_NONE = 0;
	    public static readonly int TYPE_SPRITE = 1;
	    
	    public static readonly int MODE_CLIPS = 0;
	    public static readonly int MODE_ANIMATION = 1;
	    
	    /*
	     * Variables
	     */
        public static int type = TYPE_NONE;
        public static int mode = MODE_CLIPS;
        
        public static Bitmap bitmap = null;
        
        public static Clip _root;
        
        /*
         * Init
         */
        public static void Init ()
        {
            type = TYPE_NONE;
            mode = MODE_CLIPS;
            
            /*
             * Hardcoded for now
             */
            type = TYPE_SPRITE;
            MainForm.self.MainFormSetDefaults();
            
            Stage.Init();
        }
        
        /*
         * Shutdown
         */
        public static void Shutdown ()
        {
            if (type != TYPE_NONE)
            {
                Stage.Shutdown();
            }
            
            type = TYPE_NONE;
        }
        
        /*
         * SetSourceBitmap
         */
        public static void SetSourceBitmap (string str)
        {
        	if (type == TYPE_NONE)
        	{
        		return;
        	}
        	
        	if (bitmap != null)
        	{
        		bitmap = null;
        	}
        	
        	bitmap = new Bitmap(Bitmap.FromFile(str));
        }
	}
}
